/*
 * Wire
 * Copyright (C) 2018 Wire Swiss GmbH
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 */

.uploading-asset {
  margin-top: 8px;

  .progress-bar {
    @rotation: 127deg;
    @size: 14px;
    @rotatedSize: (abs(cos(@rotation)) + abs(sin(@rotation))) * @size;
    height: 6px;
    border-radius: 100px;
    margin-left: 0;
    background-size: @rotatedSize 6px;

    > div {
      border-radius: 100px;
      background-color: var(--accent-color-500);
    }
  }
}

.progress-console {
  overflow: hidden;
  height: 14px;
  margin-bottom: 14px;
  font-size: var(--font-size-xsmall);
  text-overflow: ellipsis;
  white-space: pre;
}

.progress-bar {
  @rotation: 127deg;
  @size: 14px;
  @rotatedSize: (abs(cos(@rotation)) + abs(sin(@rotation))) * @size;

  overflow: hidden;
  width: 256px;
  height: 4px;
  border: none;
  border-radius: 2px;
  animation: move 0.5s linear infinite;
  -webkit-appearance: none;
  background-image: linear-gradient(
    @rotation,
    var(--background-fade-8),
    var(--background-fade-8) 5px,
    var(--background-fade-16) 7px,
    var(--background-fade-16) 12px,
    var(--background-fade-8) 14px
  );
  background-size: @rotatedSize 4px;
  margin-inline: auto;

  > div {
    width: 0;
    height: 100%;
    border-radius: 2px;
    background-color: @w-blue;
  }

  @keyframes move {
    0% {
      background-position: 0 0;
    }
    100% {
      background-position: @rotatedSize 0;
    }
  }
}
